import 'package:shop/utils/Storage.dart';

//全局缓存key && get set 缓存
class StorgeKey {
  ///token 缓存
  static String token = "token";
  static String storeId = "storeId";
  static String login = "login";
}

class MyStorge {
  ///token 缓存
  static String get token => StorageUtil.getString(StorgeKey.token);
  static set token(String token) =>
      StorageUtil.setString(StorgeKey.token, token);

  ///storeId 缓存
  static int get storeId => StorageUtil.getInt(StorgeKey.storeId);
  static set storeId(int storeId) =>
      StorageUtil.setInt(StorgeKey.storeId, storeId);

  ///快速登录
  static Map get login => StorageUtil.getMap(StorgeKey.login);
  static set login(Map login) => StorageUtil.setMap(StorgeKey.login, login);
}
